#include "plugin_ui_sqlite.h"
#include "sqlite_form.h"

Plugin_ui_sqlite::Plugin_ui_sqlite():
    m_sqlteWgt(nullptr)
{
}

void Plugin_ui_sqlite::initialize(mainwindowCallBack cb)
{
    if(!m_sqlteWgt)
    {
        m_sqlteWgt = new sqlite_form(cb);
    }
}

void Plugin_ui_sqlite::shutdown()
{
    if(m_sqlteWgt)
    {
        m_sqlteWgt->deleteLater();
        m_sqlteWgt = nullptr;
    }
}

QString Plugin_ui_sqlite::name() const
{
    return "Plugin_ui_sqlite";
}

QWidget *Plugin_ui_sqlite::createUI()
{
    return m_sqlteWgt ? m_sqlteWgt : nullptr;
}
